package com.lyy.consolidate.homework4;


/**
 * @Author:  GZQ
 * @date:  2024/12/1 23:37
 * @description: 巩固练习4
 */

class Employee {  // 父类

    // 属性
    // 分析出有一个带薪的月份 13, 15, 12
    private String name;
    private double sal;
    private int salMonth = 12;

    // 构造器
    public Employee(String name, double sal) {
        this.name = name;
        this.sal = sal;
    }

    // getter setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSal() {
        return sal;
    }

    public void setSal(double sal) {
        this.sal = sal;
    }

    public int getSalMonth() {
        return salMonth;
    }

    public void setSalMonth(int salMonth) {
        this.salMonth = salMonth;
    }

    // 方法
    public void printSalary() {
        System.out.println(name + " 的年工资是 " + (sal * salMonth));
    }

}
